// 1->2->3
// 1<-2<-3

function Node(val) {
  this.value = val;
  this.next = null;
  this.pre = null;
}

let node1 = new Node(1);
let node2 = new Node(2);
let node3 = new Node(3);

// 此时已存在三个节点，然后需要将其先后关系链接起来

node1.next = node2;
node2.next = node3;
node3.pre = node2;
node2.pre = node1;

console.log(node1, node2, node3);